package com.zlp.mall.search.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * Item_spu 搜索商品的信息
 * @since 2021-11-3 11:14:50
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Document(indexName = "spu2", shards = 2,replicas = 0)
public class EsSpu implements Serializable {
    private static final long serialVersionUID = -1L;


    /**
     * 作用在成员变量，标记一个字段作为id主键
     */
    @Id
    @Field(type = FieldType.Keyword)
    private Long id;


    @ApiModelProperty(value = "商品类型：51121001-实物商品（自营），51121002-第三方卡券，51121003-服务合同，51121004-实物商品（第三方）")
    private String itemType;

    @ApiModelProperty(value = "客户端ID")
    private Integer clientId;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "商品库的spu的业务id")
    private String spuBusId;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "商品名称")
    private String name;

    @ApiModelProperty(value = "商品的价格（单位：分）")
    private Integer price;

    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    @ApiModelProperty(value = "商品描述")
    private String description;

    @ApiModelProperty(value = "上架时间")
    private Long upTime;

    @ApiModelProperty(value = "权重值")
    private Integer score;

    @ApiModelProperty(value = "销量")
    private Integer sales;

    @ApiModelProperty(value = "浏览量")
    private Integer views;

    @ApiModelProperty(value = "状态:60291001-草稿， 60291002-待上架， 60291003-上架中， 60291004-已下架")
    private Integer status;


}
